
//   F - binary.cpp

#include <bits/stdc++.h>

using namespace std;
const int MAXN = 2e5 + 5;
int a[MAXN], b[MAXN], c[MAXN], n, k;

long long f(int i, int j, int k) {
  return 1ll * a[i] * b[j] + 1ll * b[j] * c[k] + 1ll * c[k] * a[i];
}

bool chk(long long mid) {
  // >=mid的数量是否 >=K
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (f(i, 1, 1) < mid)
      break;
    for (int j = 1; j <= n; ++j) {
      if (f(i, j, 1) < mid)
        break;
      for (int k = 1; k <= n; ++k) {
        if (f(i, j, k) < mid)
          break;
        ++cnt;
        if (cnt == ::k)
          return true;
      }
    }
  }
  return false;
}

int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i);
  for (int i = 1; i <= n; ++i)
    scanf("%d", b + i);
  for (int i = 1; i <= n; ++i)
    scanf("%d", c + i);
  sort(a + 1, a + n + 1, [](int x, int y) -> bool { return x > y; });
  sort(b + 1, b + n + 1, [](int x, int y) -> bool { return x > y; });
  sort(c + 1, c + n + 1, [](int x, int y) -> bool { return x > y; });
  long long l = 0, r = 3e18, ans = -1;
  printf("%d\n", chk(34)); // exit(0);

  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (chk(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%lld\n", ans);
  return 0;
}